import request from '@/utils/request'


// 获取频道新闻推荐

export const articles = data => {
    return request.get('/v1_1/articles', {
        params : data
    })
}


// 获取所有频道类表
export const allChannels = () => {
    return request.get('/v1_0/channels')
}


// 获取新闻文章详情

export const articlesDetails = (id) => {
    return request.get(`/v1_0/articles/${id}`)
}


//收藏文章  点亮星星

export const collections = (id) => {
    return request.post(`/v1_0/article/collections`,{
        target : id
    })
}


// 取消收藏文章 灭掉星星

export const collectionsDel = (id) => {
    return request.delete(`/v1_0/article/collections/${id}`)
}



//添加评论或评论回复


export const commentsPost = (obj) => {
    return request.post(`/v1_0/comments`, obj)
}


//获取评论或评论回复

export const commentsGet = (params) => {
    return request.get(`/v1_0/comments`, {params})
}
